When an application is executed on a device, the application often declares and instantiates variables that represent the state of the application or settings of the application that are customizable by users. These variables are usually assigned with initial values (i.e., default values) to represent the initial state or settings of the application when the application is initiated. As the application runs, the values of these variables may change to represent a different state of the application and/or a changed setting by the user. For instance, the state of the application is changed when one or more document files are opened or closed by the application, or when the window location of an opened document file is changed. Similarly, the setting of the application is changed when the user selects a different appearance of the graphical user interface (GUI) of the application.
Often times, the users of the application would like to have the changed state of the application and the changed settings persist across termination and relaunch of the application, so that the application will operate under the latest (most updated) state and settings (rather than the default state and settings) the next time the application is initiated. In order for the application to operate under the customized settings each time it is launched, the variables that have been updated must be saved on a disk before the application is terminated and retrieved from the disk when the application is initiated.
Historically, applications that persist the customized settings have to be coded extensively to implement the archiving and unarchiving of the variables that represent the state settings of the application. Specifically, the author of the applications must write numerous lines of programming code to perform the archiving and unarchiving operations. Such coding is often time consuming and prone to causing errors.